/*
* Copyright (c) 2011 Connection Road.  All rights reserved.
* This program and the accompanying material are made available
* under the terms of the Eclipse Public Licnese v1.0 which is
* available at http://www.eclipse.org/legal/epl-v10.html
*/

using System;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using CrSyncFilesForms.Properties;
using CrSyncFilesForms.Utils;

namespace CrSyncFilesForms
{
    public partial class CrSyncUiAbout : Form
    {
        public CrSyncUiAbout()
        {
            InitializeComponent();

            AcceptButton = ButtonClose;
            CancelButton = ButtonClose;

        }

        private void ButtonCloseClick(object sender, EventArgs e)
        {
            Close();
        }

        private void CallBackLoad(object sender, EventArgs args)
        {
            var productVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            var buildDate = Settings.Default.CFG_BUILD_DATE;
            LinkHomePage.Text = Settings.Default.CFG_URL_PRODUCTS_PAGE;

            LabelAbout.Text = string.Format(Resources.TEXT_ABOUT, productVersion, string.Empty, buildDate);
        }

        private void CalBackGoToHomePage(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start(new ProcessStartInfo(Settings.Default.CFG_URL_PRODUCTS_PAGE));
        }
    }
}
